package net.huashitong.scheduling.dao;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;
import net.huashitong.scheduling.entity.TownRankDetail;
import net.huashitong.scheduling.entity.TownRankList;
import net.huashitong.scheduling.filter.ProjectReserveFilter;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public class TownRankDetailDao  extends StringDao<TownRankDetail> {

    public List<TownRankDetail>  queryByfilterAndStudentId(ProjectReserveFilter filter){
        GenericQuery query = createQuery("obj");
        query.append(" and obj.month = :month").setParam("month",filter.getMonth());
        query.append(" and obj.year = :year").setParam("year",filter.getYear());
        query.append(" and obj.studentId = :studentId").setParam("studentId",filter.getParentId());

        return query.listResult();
    }
}
